import Vue from "vue";
import Router from 'vue-router'

Vue.use(Router)

const constantRoutes = [
  {
    path: '/',
    component: () => import('@/views/putInfo/login.vue'),
    name: 'login',
  },
  {
    path: '/putInfo',
    name:'putInfo',
    component: () => import('@/views/putInfo/putInfo.vue')
  } 
]
const createRouter = () => new Router({
  mode: 'hash', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router